In recent years many electronic devices that include remote parts as part of an entire system, and which were traditionally connected by wires or cables, are implemented using wireless links. An example of such a system is a home theater system with wireless speakers. The use of wireless speakers simplifies installation and enhances the freedom of positioning the speakers, since the speakers do not need to be connected by communication cables to a central device.
In a streaming data system, which transmits a data stream to remote wireless devices (e.g. a DVD or CD player that produces streaming audio data at its playback rate to wireless speakers), the data stream is provided at a specific rate, which is dictated by the data source. In some cases, a crystal or clock oscillator is used to set the data stream's clock rate, (e.g. when using an analog to digital data converter operating on analog based audio). Alternatively the data stream's clock rate is extracted from the data source, for example from a CD or DVD. In a wireless system the data stream is encoded and transmitted by a transmitter, typically at a higher transmission rate, to a receiver, which receives, decodes and stores the data stream in a local receiver buffer in order to recover the original data stream at the playback rate. The data stream is then extracted from the local receiver buffer, substantially at the same rate that it is originally provided to the transmitter, to produce an equivalent data stream at the receiver end, for example at multiple remote speakers.
In a wired system a synchronization line is typically used, providing a clock signal simultaneously to the transmitter and receiver to synchronize between the data source and its associated playback device. Typically, in a wireless system the receiver is not directly synchronized with the transmitter and needs to rely on its local crystal or local clock oscillator to recover the original data stream at substantially the rate it was originally provided to the transmitter. If there is a slight variance between these two rates (referred to as clock rate mismatch (CRM)), it will result in an overflow or underflow of the local receiver buffer, since the receiver will playback the data stream at a slightly different rate. In a typical wireless streaming data system, based on crystals, the variance is typically in the range of 30-200 parts per million (PPM). The variance introduces a problem in handling the local receiver buffer. If the receiver plays back the streaming data slower than the original playback rate it would cause an overflow of the local receiver buffer and a loss of data. In an audio system, as an example, the listener would hear clicks and pops in the audio signal (e.g. every few seconds). If the receiver plays back the data too fast it would cause an underflow of the local receiver buffer with similar phenomena.
Even if a system implementer uses crystals or clock oscillators from the same manufacturing batch at the transmitter and receiver to set their clock rates, there is always a slight difference between their operating rates due to physical tolerances introduced by the physical nature of the clocking devices. The extent of this discrepancy can be reduced by measuring many crystals and selecting those that have the closest values; however the problem can never be eliminated. The problem is more severe when there are multiple receivers, each with a slightly different rate, since they will not be synchronized to each other while playing back the data.
When transmitting a wireless audio data stream, a solution, which minimizes the noticeability by a listener of the clock rate mismatch between the transmitter and receiver is implemented by introducing warning marks, indicating that the high (full) and low (empty) ends of the local receiver buffer have been reached. A typical buffer for audio data may comprise a first in first out (FIFO) memory comprising a few hundred words (e.g. 128), wherein each word is a sample of a measurement of an analog audio signal (e.g. a 16 or 24 bit value). The low end warning mark represents a mark which is placed at a pre-selected distance from the low end of the buffer. The high end warning mark represents a mark which is placed at a pre-selected distance from the high end of the buffer. During wireless system usage, the local receiver buffer is filled in bursts by the higher rate transmission, and emptied continuously at substantially the data source audio playback rate plus or minus a small variance as described above. If the content of the local receiver buffer goes below the low end warning mark, one word value is repeated from the buffer. This keeps the playback data stream continuous, and provides a small delay that prevents the local receiver buffer from reaching its empty state before being refilled by the next wireless data transmission burst. It should be noted that the discrepancy between the clocks is very small so that one single repeated word value (e.g. a single audio sample) should be enough to fix clock rate mismatch accumulation. Additionally, since the original signal is generally a continuous signal, the repeated value is typically close to the real value so that it keeps the playback data stream continuous, and this discrepancy is generally, inaudible with playback audio.
Likewise, if the content of the buffer goes above the high end warning mark, one word value is discarded from the data stream in order to fix clock rate mismatch accumulation. As with the low end warning mark, a single discarded value is generally inaudible with playback audio and will prevent an overflow, which could cause more serious data loss when receiving a transmission.
The above method provides a relatively simple solution for adjusting between the original playback rate and the remote playback rate of a data stream, and in an audio data application is essentially inaudible to the human listener. However, this solution introduces harmonic distortion and generally degrades the total harmonic distortion (THD) performance of an audio signal relative to the original signal and is detectable by professional measuring equipment. The above solution is also unsatisfactory when the audio signal is rich with high frequency audio signal content (e.g. close to the sampling rate) so that the difference in value between two consecutive audio samples is significant, and any addition or removal of an audio sample is, in this case, audible to the human listener. Additionally, the solution is problematic for other types of data streams (e.g. non audio) where the loss of a sampled data value may be more noticeable or even catastrophic for the wireless system.
Another method, which provides a solution for handling clock rate mismatch (CRM), is known as sample rate conversion (SRC). In this method the receiver calculates intermediate values, between original data samples, using an interpolation scheme based on the received discrete sample data values. The receiver then re-samples this higher sampled rate signal using a decimation scheme to provide a newly sampled signal at the desired receiver playback rate. The receiver can therefore produce a digital (e.g. audio signal) essentially at any sampling rate, for example at the average of the original playback rate. In this case, local receiver buffer overflow and underflow are avoided.
U.S. Pat. No. 6,252,919 to LIN describes re-synchronization of independently clocked audio streams by fading in with a fractional sample over multiple periods for sample rate conversion.
The use of sample rate conversion requires a fast processor and/or a large memory area to perform complex calculations. Furthermore, an SRC scheme introduces THD to a certain extent, depending on the type and resolution (e.g. quantization) of the performed calculations. This increases the complexity and cost of the receivers making it less attractive as a solution, especially for mid to low end systems.
Another method of providing a solution for handling clock rate mismatch is by using a numerically controlled oscillator (NCO) in the receiver to continuously correct the receiver's playback clock frequency according to the original average playback rate. A numerically controlled oscillator can produce a synthetic frequency according to various system parameters. Examples of integrated circuits that can produce such an output are AD9830/3 and AD9852/4 from Analog Devices. As described above, the low and high warning marks in the local receiver buffer can be used to give indication if the receiver's NCO circuit is too fast or too slow. The NCO would then automatically correct itself to provide a slightly faster or slightly slower playback rate by the receiver according to the status of the local receiver buffer. Typically, the NCO clock rate converges quickly to a specific value, which is the average of the original playback rate.
U.S. patent publication No. 2003/0043945 to Mujica et al. describes an apparatus, system and method for synchronizing a local clock signal with a remote clock signal in a communication network using an NCO.
The use of a numerically controlled oscillator, as with an SRC scheme, tends to be complex to implement, and typically requires a large look up table (LUT) for generating the sine wave sample values, as well as an external digital to analog converter to provide for the continuous analog frequency clock signal. Therefore it would be preferable to find a simpler, less costly solution, which could rely on a crystal as a clock source without requiring a numerically controlled oscillator, which typically leads to a higher receiver cost.
U.S. patent application publication number 2004/0223622 to Lindemann et al., published on Nov. 11, 2004, the disclosure of which is incorporated herein by reference describes a digital wireless loudspeaker system, which wirelessly transmits digital audio data using an RF transmission system. In Lindemann et al. the data is modulated over an RF carrier signal and extracted from the carrier signal by the receivers.
In contrast to that described by Lindemann et al., in baseband transmission systems only raw data pulses, (e.g. ‘1’ and ‘0’ bits), without modulation over a frequency based carrier, are transmitted over the wireless medium for reconstruction of the data signal and its inherent clock signal in the receiver. Therefore Lindemann et al. would not be applicable to such systems.